﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="carduserlevel_setup.aspx.cs"
    Inherits="EZCRS.HCMS.Web.manage.carduser.carduserlevel_setup" %>

<%@ Register Src="../usercontrol/titlepage.ascx" TagName="titlepage" TagPrefix="uc2" %>
<%@ Register Assembly="Book38.Net.CustomControl" Namespace="Book38.Net.CustomControl"
    TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>

    <script language="javascript">
        function goUp(obj, cellnum) {
            curRow = obj.parentElement.parentElement;
            var curLn = curRow.rowIndex;
            var lastLn = curRow.rowIndex - 1;

            if (curLn != 1) {
                lastRow = obj.parentElement.parentElement.parentElement.rows[lastLn];
                for (var i = 0; i < cellnum; i++) {
                    tmpHtml = curRow.cells[i].innerHTML;
                    curRow.cells[i].innerHTML = lastRow.cells[i].innerHTML;
                    lastRow.cells[i].innerHTML = tmpHtml;
                }
            } else {
                alert("Cannot move up");
            }
        }

        //-----order list go down------

        function goDown(obj, cellnum) {
            totalRows = obj.parentElement.parentElement.parentElement.rows.length - 1;
            curRow = obj.parentElement.parentElement;
            var curLn = curRow.rowIndex;
            var lastLn = curRow.rowIndex + 1;

            if (totalRows != curLn) {
                lastRow = obj.parentElement.parentElement.parentElement.rows[lastLn]
                for (var i = 0; i < cellnum; i++) {
                    tmpHtml = curRow.cells[i].innerHTML;
                    curRow.cells[i].innerHTML = lastRow.cells[i].innerHTML;
                    lastRow.cells[i].innerHTML = tmpHtml;
                }
            } else {
                alert("Cannot Move Down!");
            }
        }
        function savesort() {
            obj = $F("gvList");
            var str = "";
            for (var i = 1; i < obj.rows.length; i++) {
                str += "," + obj.rows[i].cells[0].innerHTML;
            }
            EZCRS.HCMS.myajax.OtherUtils.save_userlevel(str, resps);
        }
        function resps(resp) {
            if (resp.value == "1")
                alert("更新成功！");
        }
    </script>

</head>
<body>
    <form id="formData" runat="server">
    <uc2:titlepage ID="Titlepage1" runat="server" inittitle="<%$ Resources:Site, LabCardUserLevelSetup %>">
    </uc2:titlepage>
    <div class="optbar">
        <a href="javascript:savesort();" class="blue" onmouseover="currentcolor=this.style.backgroundColor;this.style.backgroundColor='#B9CEEA';"
            onmouseout="this.style.backgroundColor=currentcolor;">
            <img src="../../image/save.gif" border="0" align="absmiddle" />保存级别</a></div>
    <asp:GridView ID="gvList" runat="server" AlternatingRowStyle-CssClass="line-even"
        CssClass="main-table" OnRowDataBound="gvList_DataBinding" AutoGenerateColumns="False"
        CellPadding="1" EmptyDataRowStyle-HorizontalAlign="center" EmptyDataText="<%$ Resources:Site, LabNoData %>"
        HeaderStyle-CssClass="minfo-title" PageSize="15" RowStyle-CssClass="line-odd"
        OnRowEditing="gvList_RowEditing" DataKeyNames="lvlid">
        <EmptyDataRowStyle HorizontalAlign="Center" />
        <Columns>
            <asp:BoundField DataField="lvlid" FooterText="编号" HeaderText="等级编号">
                <ItemStyle HorizontalAlign="Center" />
                 <HeaderStyle CssClass="minfo-title" />
            </asp:BoundField>
            <asp:BoundField DataField="lvlname" HeaderText="<%$ Resources:Site, LabCardUserLevelLvLname %>">
                <ItemStyle Width="150px" />
                   <HeaderStyle CssClass="minfo-title" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="<%$ Resources:Site, LabCardUserLevelLvLimg %>">
                <ItemStyle Width="80px" />
                   <HeaderStyle CssClass="minfo-title" />
                <ItemTemplate>
                    <asp:Image ImageUrl='<%# Bind("lvlimg") %>' runat="server" ID="imgid" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="startscore" HeaderText="<%$ Resources:Site, LabCardUserLevelScore %>">
              <HeaderStyle CssClass="minfo-title" />
            </asp:BoundField>
            <asp:BoundField DataField="indate" HeaderText="<%$ Resources:Site, LabCardUserLevelInDate %>">
                <ItemStyle Width="140px" />
                <HeaderStyle Width="140px" />
                  <HeaderStyle CssClass="minfo-title" />
            </asp:BoundField>
            <asp:BoundField DataField="inuser" HeaderText="<%$ Resources:Site, LabCardUserLevelInUser %>">
                <ItemStyle Width="80px" />
                  <HeaderStyle CssClass="minfo-title" />
            </asp:BoundField>
            <asp:BoundField DataField="lvlcount" HeaderText="<%$ Resources:Site, LabCardUserLevelLvLcount %>">
                <ItemStyle Width="80px" />
                  <HeaderStyle CssClass="minfo-title" />
            </asp:BoundField>
            <asp:TemplateField>
                <HeaderTemplate>
                    <asp:Label runat="server" ID="LabEdit" Text="<%$ Resources:Site, LabEdit %>"></asp:Label></HeaderTemplate>
                <HeaderStyle Width="80px" />
                <ItemStyle HorizontalAlign="Center" />
                  <HeaderStyle CssClass="minfo-title" />
                <ItemTemplate>
                    <asp:LinkButton ID="Edit" runat="server" CommandName="Edit">
                                <img src="../../Image/modify.gif" alt="编辑" style="border:0; " />
                    </asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="级别">
                <ItemTemplate>
                    <img onclick="javascript:goUp(this,7);" src="../../image/uparrow.png">&nbsp;
                    <img onclick="javascript:goDown(this,7);" src="../../image/downarrow.png">
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Width="50px" />
                  <HeaderStyle CssClass="minfo-title" />
            </asp:TemplateField>
        </Columns>
        <RowStyle CssClass="line-odd" />
       
        <AlternatingRowStyle CssClass="line-even" />
    </asp:GridView>
    <br />
    <table class="main-table" cellspacing="1">
        <tr class="line-odd">
            <td colspan="2">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="9%">
                            <asp:Label runat="server" ID="LabCardUserLevelLvLname" Text="<%$ Resources:Site, LabCardUserLevelLvLname %>"></asp:Label>：
                        </td>
                        <td width="48%">
                            &nbsp;<cc1:webtextbox id="txt_lvlname" runat="server" width="185px" cssclass="text-line"
                                maxlength="50"><Value>
</Value>
</cc1:webtextbox>
                        </td>
                        <td width="8%">
                            <asp:Label runat="server" ID="LabCardUserLevelLvLimg" Text="<%$ Resources:Site, LabCardUserLevelLvLimg %>"></asp:Label>：
                        </td>
                        <td width="35%">
                            <asp:RadioButtonList ID="txt_lvlimg" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="/image/carduser0.gif" Selected="True">&lt;img src=&quot;../../image/carduser0.gif&quot; /&gt;</asp:ListItem>
                                <asp:ListItem Value="/image/carduser1.gif">&lt;img src=&quot;../../image/carduser1.gif&quot; /&gt;</asp:ListItem>
                                <asp:ListItem Value="/image/carduser2.gif">&lt;img src=&quot;../../image/carduser2.gif&quot; /&gt;</asp:ListItem>
                                <asp:ListItem Value="/image/carduser3.gif">&lt;img src=&quot;../../image/carduser3.gif&quot; /&gt;</asp:ListItem>
                                <asp:ListItem Value="/image/carduser4.gif">&lt;img src=&quot;../../image/carduser4.gif&quot; /&gt;</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;<asp:Label runat="server" ID="LabCardUserLevelScore" Text="<%$ Resources:Site, LabCardUserLevelScore %>"></asp:Label>：
                        </td>
                        <td>
                            &nbsp;<cc1:webtextbox id="txt_startscore" runat="server" allowempty="False" cssclass="text-line"
                                validtype="Int" width="50px"><Value>
</Value>
</cc1:webtextbox>&nbsp; -<cc1:webtextbox id="txt_endscore" runat="server" allowempty="False"
    cssclass="text-line" validtype="Int" width="50px"><Value>
</Value>
</cc1:webtextbox>&nbsp;
                            <asp:Label runat="server" ID="LabCardUserLevelNote1" Text="<%$ Resources:Site, LabCardUserLevelNote1 %>"></asp:Label>
                        </td>
                        <td>
                            <asp:Label runat="server" ID="LabCardUserLevelDefine" Text="<%$ Resources:Site, LabCardUserLevelDefine %>"></asp:Label>：
                        </td>
                        <td>
                            <asp:Literal ID="ltl_simg" runat="server"></asp:Literal>&nbsp;<input id="txt_simg"
                                runat="server" type="file" width="300px" cssclass="text-line" class="text-line"
                                onkeydown="return false" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label runat="server" ID="LabCardUserLevelDays" Text="<%$ Resources:Site, LabCardUserLevelDays %>"></asp:Label>：
                        </td>
                        <td>
                            &nbsp;<cc1:webtextbox id="txt_days" runat="server" cssclass="text-line" validtype="Int"
                                width="50px"><Value>
</Value>
</cc1:webtextbox>&nbsp;
                            <asp:Label runat="server" ID="LabCardUserLevelNote2A" Text="<%$ Resources:Site, LabCardUserLevelNote2 %>"></asp:Label>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <tr>
                            <td>
                                <asp:Label runat="server" ID="LabCardUserLevelHotels" Text="<%$ Resources:Site, LabCardUserLevelHotels %>"></asp:Label>：
                            </td>
                            <td colspan="3">
                                &nbsp;<cc1:webtextbox id="txt_hotels" runat="server" cssclass="text-line" validtype="Int"
                                    width="50px"><Value>
</Value>
</cc1:webtextbox>&nbsp;
                                <asp:Label runat="server" ID="LabCardUserLevelNote2B" Text="<%$ Resources:Site, LabCardUserLevelNote2 %>"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label runat="server" ID="LabCardUserLevelLvLcount" Text="<%$ Resources:Site, LabCardUserLevelLvLcount %>"></asp:Label>：
                            </td>
                            <td colspan="3">
                                &nbsp;
                                <asp:Label ID="txt_lvlcount" runat="server" Text="0"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label runat="server" ID="LabCardUserLevelLvLcomment" Text="<%$ Resources:Site, LabCardUserLevelLvLcomment %>"></asp:Label>：
                            </td>
                            <td colspan="3" rowspan="2">
                                &nbsp;<cc1:webtextbox id="txt_lvlcomment" runat="server" height="61px" textmode="MultiLine"
                                    width="456px" cssclass="text-line"></cc1:webtextbox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                &nbsp;<asp:HiddenField ID="HiddenField1" runat="server" />
                                <asp:HiddenField ID="LvlId" runat="server" Value="0" />
                                <asp:Button ID="BtnAdd" runat="server" CssClass="bttn" Text="<%$ Resources:Site, ButtonSave %>"
                                    OnClick="BtnAdd_Click" />
                                <asp:Button ID="BtnDel" runat="server" CssClass="bttn" OnClick="BtnDel_Click" Text="<%$ Resources:Site, ButtonDel %>"
                                    Visible="false" />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td colspan="3">
                                <asp:Label runat="server" ID="LabCardUserLevelNote3" Text="<%$ Resources:Site, LabCardUserLevelNote3 %>"></asp:Label>
                            </td>
                        </tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
